package com.stottlerhenke.simbionic.engine.parser;
import com.stottlerhenke.simbionic.engine.core.*;
import com.stottlerhenke.simbionic.api.*;


public class SB_ExpVariable extends SB_Expression {
  protected String _id;
  public SB_ExpVariable(String id) {
    super();
    _id = id;
  }

  public EExpressionType GetType(){ return EExpressionType.kVariable; }
  public String GetName(){ return _id;}
  public SB_Variable Evaluate(SB_Entity entity, SB_ExecutionFrame contextFrame)
  	throws SB_Exception
  {
      SB_Variable returnValue = contextFrame.GetVariable(_id);
      returnValue = returnValue.Clone();
      return returnValue;
  }
  
  public String PrintTree() throws SB_Exception{
    return new String("variable(" + _id + ")");
  }

}